package com.yykj.user.center.server.model;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yykj.common.util.serializer.LocalDate2LongSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @author chenl
 * @version 1.0
 * @date 2021/11/9 17:22
 */
@Data
@Entity
public class InspectOrder {

    @Id
    private String id;

    @ApiModelProperty("检查/检测项目Id")
    @Column(length = 2000)
    private String itemIds;

    @ApiModelProperty("检查/检测项目姓名")
    @Column(length = 2000)
    private String itemNames;

    private String patientCardId;

    private String patientName;

    private String cardNo;

    @ApiModelProperty("检查目的")
    @Column(columnDefinition = "text")
    private String purpose;

    @ApiModelProperty("注意事项")
    @Column(columnDefinition = "text")
    private String attention;

    @ApiModelProperty("创建时间")
    @JsonSerialize(using = LocalDate2LongSerializer.class)
    @CreationTimestamp
    private LocalDateTime createTime;

    @ApiModelProperty("更新时间")
    @JsonSerialize(using = LocalDate2LongSerializer.class)
    @UpdateTimestamp
    private LocalDateTime updateTime;

    @ApiModelProperty("申请医生Id")
    private Integer appDoctorId;

    @ApiModelProperty("申请医生姓名")
    private Integer appDoctorName;

    @ApiModelProperty("类型：1检查 2检验")
    private Integer orderType;

    @ApiModelProperty("就诊科室ID")
    private Integer seeDeptId;

    @ApiModelProperty("就诊科室名称")
    private String seeDeptName;

    @ApiModelProperty("检查检验单Id")
    private String inspectId;

    private String orderNo;

    @ApiModelProperty("支付金额")
    @Column(precision = 10,scale = 2)
    private BigDecimal payAmount;

    @ApiModelProperty("支付时间")
    @JsonSerialize(using = LocalDate2LongSerializer.class)
    private LocalDateTime payTime;

    @ApiModelProperty("退款时间")
    @JsonSerialize(using = LocalDate2LongSerializer.class)
    private LocalDateTime refundTime;

    @ApiModelProperty("患者支付状态-1:取消,0:待支付,1:已支付")
    @Column(length = 1)
    private Integer payStatus=0;

    @ApiModelProperty("患者退款状态-1:未退款,0:申请退款,1:已退款,2:退款失败")
    @Column(length = 1)
    private Integer refundStatus=-1;

    @ApiModelProperty("支付方式,1:微信,2:支付宝")
    @Column(length = 1)
    private Integer payType=1;

    private String sex;

    private Integer age;

    private String birthday;

    private String relation;

}
